package org.bai.miaoshaproject.validator;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName ValidationResult
 *
 * @author Bai
 * @version 1.0
 * @date 2019/6/1 0001 上午 11:19
 **/
@Data
public class ValidationResult {

    /** 是否有错误 */
    private boolean hasErrors = false;

    /** 存放错误的的信息 */
    private Map<String, String> errorMsgMap = new HashMap<>();

    public String getErrorMsg() {
        return StringUtils.join(errorMsgMap.values().toArray(), ",");
    }
}
